// JavaScript Document

$(document).ready(function() { 
    $(document).live('keypress', function(e) {
        if (e.keyCode == 13 && $('.bnt_search').is(":focus")) {
            var url =  weebroot + "/tim-kiem/q:" + $('#searchText').val();
            $('#frmSearch').attr('action', url);
            $('#frmSearch').submit();
        }
    });
    
    //get price by type(mobile, accessory) and color
    $('.color_price').live('click', function(e) {
        var type = $(this).attr('rev');
        var record_id = $(this).attr('data-record');
        var color_id = $(this).attr('rel');
        
        
        $.getJSON(weebroot + "ajax/get_price_by_type_color/", 
            { type: type, idRecord: record_id, idColor: color_id },
            function(data) {

            }
        );
    });
});
